package com.zoe.app.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.zoe.app.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Zoe.Zhang
 * @date 2021/12/17
 * @description
 */
@RestController
public class HelloController {
    @Autowired
    User user;

    @GetMapping("/")
    public String getUser() throws JsonProcessingException {
        return new ObjectMapper().writeValueAsString(user);
    }
}
